//
//  UILabel+Extension.swift
//  NBSinaWeibo
//
//  Created by ac on 16/5/23.
//  Copyright © 2016年 ac. All rights reserved.
//

import UIKit

extension UILabel{
    convenience init(title: String, fontSize: CGFloat, textAlign: NSTextAlignment = .Center, textColor: UIColor){
        self.init()
        self.text = title
        self.font = UIFont.systemFontOfSize(fontSize)
        self.textAlignment = textAlign
        self.textColor = textColor
        self.numberOfLines = 0
        
        if textAlign == NSTextAlignment.Left {
            preferredMaxLayoutWidth = ScreenWidth - 2 * CellMargin
        }
        self.sizeToFit()
    }
}
